package exchange

import (
	"banzhuan/models"
	"encoding/json"
	"log"
)

func GetBlance(asset string) (int,int) {
	balanceReq:=new(models.BalanceReq)
	balanceReq.Asset=asset

	postData,_:=json.Marshal(balanceReq)
	body:=EncyMd5(string(postData),"trader","balance")

	balanceRespon:=new(models.BalanceRespon)
	err:=json.Unmarshal(body,&balanceRespon)
	if err!=nil {
		log.Println("GetBalance error:",err)
	}

	return balanceRespon.Available,balanceRespon.Denom

	//available:=balanceRespon.Available
	//denom:=balanceRespon.Denom
}
